home *** CD-ROM | disk | FTP | other *** search
- Path: prairie.nodak.edu!not-for-mail
- From: wstark@prairie.nodak.edu (Just Me)
- Newsgroups: comp.lang.c
- Subject: Re: RETURN ();
- Date: 9 Feb 1996 23:47:34 -0600
- Organization: North Dakota Higher Education Computing Network (NDHECN)
- Message-ID: <4fhbhm$c8g@prairie.nodak.edu>
- References: <DMFxxq.7M7@emi.net> <4fc6ve$kbn@s02.pavilion.co.uk>
- NNTP-Posting-Host: prairie.nodak.edu
- Mime-Version: 1.0
- Content-Type: text/plain; charset=US-ASCII
- Content-Transfer-Encoding: 7bit
-
- In article <4fc6ve$kbn@s02.pavilion.co.uk>,
- Andy J Robb <AJRobb@pavilion.co.uk> wrote:
- >main(int, char**) /* This says "ignore the command line" */
-
- This may be a valid prototype, but it is NOT a valid definition. There
- is absolutely nothing wrong with:
-
- int main(void)
-
- and it means exactly what you intend:
-
- int main(int, char **)
-
- to mean, but also has the feature of actually working.
-
- >#include <stdio.h>
-
- >void Input_data(int *x, int *y, int *z)
- >{
- > *x = 5;
- > *y = 30;
- > *z = 10;
- >}
-
- >main(int, char**)
- >{ int x, y, z;
- > Input_data(&x, &y, &z);
-
- > printf("here are the data: x=\"%d\", y=\"%d\", z=\"%d\"\n", x,y,z);
-
- > return 0;
- >}
-
- Did you actually try to compile this before posting? I could not find one
- single compiler that would accept your version of main(). It does work
- as intended, if you change your definition of main() to : main(void),
- main(int argc, char **argv), or just main().
-
- --
- wstark@prairie.nodak.edu
- ***************************************************************************
- If they don't keep on exercising their lips, their brains start working.
- -- Ford Prefect's theory on humans, Hitchhikers Guide to the Galaxy.
- ***************************************************************************
-